﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;

namespace nelech.Models.DBModel
{
    public partial class Place : IDataErrorInfo
    {
        private Dictionary<string, string> _errors = new Dictionary<string, string>();

        partial void OndescriptionChanging(string value)
        {
            if (value == null || value.Trim().Length == 0)
                _errors.Add("description", "חובה למלא פרטים על המקום");
        }
        partial void  OnnameChanging(string value)

        {
            if (value == null || value.Trim().Length == 0)
                _errors.Add("name", "חובה למלא שם");
        }
       

        #region IDataErrorInfo Members

        public string Error
        {
            get
            {
                return string.Empty;
            }
        }

        public string this[string columnName]
        {
            get
            {
                if (_errors.ContainsKey(columnName))
                    return _errors[columnName];
                return string.Empty;
            }
        }

        #endregion
    }
}
